﻿using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

namespace Sizebox.CharacterEditor
{
	// Token: 0x0200024F RID: 591
	public class MaterialEmissionToggleOption : MaterialControlOption
	{
		// Token: 0x06000CD7 RID: 3287 RVA: 0x00067A04 File Offset: 0x00065C04
		private void Awake()
		{
			this.toggle.onValueChanged.AddListener(new UnityAction<bool>(this.ToggleKeyword));
		}

		// Token: 0x06000CD8 RID: 3288 RVA: 0x00067A22 File Offset: 0x00065C22
		public override void ValidateOption(MaterialEntryGui selected, List<MaterialEntryGui> newGuis)
		{
			base.ValidateOption(selected, newGuis);
			if (this.selectedGui == null)
			{
				return;
			}
			this.toggle.isOn = this.selectedGui.Wrapper.UseEmission;
		}

		// Token: 0x06000CD9 RID: 3289 RVA: 0x00067A5C File Offset: 0x00065C5C
		private void ToggleKeyword(bool value)
		{
			if (this.selectedGuis == null)
			{
				return;
			}
			foreach (MaterialEntryGui materialEntryGui in this.selectedGuis)
			{
				materialEntryGui.Wrapper.UseEmission = value;
			}
		}

		// Token: 0x040011DD RID: 4573
		[SerializeField]
		private Toggle toggle;
	}
}
